3.3.85 \(\int \frac {(a B+b B \cos (c+d x)) \sec (c+d x)}{a+b \cos (c+d x)} \, dx\) [285]

Optimal. Leaf size=12 \[ \frac {B \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

B*arctanh(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {21, 3855} \begin {gather*} \frac {B \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a*B + b*B*Cos[c + d*x])*Sec[c + d*x])/(a + b*Cos[c + d*x]),x]

[Out]

(B*ArcTanh[Sin[c + d*x]])/d

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {(a B+b B \cos (c+d x)) \sec (c+d x)}{a+b \cos (c+d x)} \, dx &=B \int \sec (c+d x) \, dx\\ &=\frac {B \tanh ^{-1}(\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 12, normalized size = 1.00 \begin {gather*} \frac {B \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a*B + b*B*Cos[c + d*x])*Sec[c + d*x])/(a + b*Cos[c + d*x]),x]

[Out]

(B*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 20, normalized size = 1.67

method result size
derivativedivides \(\frac {B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(20\)
default \(\frac {B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(20\)
norman \(\frac {B \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {B \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(37\)
risch \(\frac {B \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {B \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) \(39\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*B+b*B*cos(d*x+c))*sec(d*x+c)/(a+b*cos(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*B*ln(sec(d*x+c)+tan(d*x+c))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*B+b*B*cos(d*x+c))*sec(d*x+c)/(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
 for more de

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (12) = 24\).
time = 0.39, size = 31, normalized size = 2.58 \begin {gather*} \frac {B \log \left (\sin \left (d x + c\right ) + 1\right ) - B \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*B+b*B*cos(d*x+c))*sec(d*x+c)/(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(B*log(sin(d*x + c) + 1) - B*log(-sin(d*x + c) + 1))/d

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (10) = 20\).
time = 2.26, size = 39, normalized size = 3.25 \begin {gather*} \begin {cases} \frac {B \log {\left (\tan {\left (c + d x \right )} + \sec {\left (c + d x \right )} \right )}}{d} & \text {for}\: d \neq 0 \\\frac {x \left (B a + B b \cos {\left (c \right )}\right ) \sec {\left (c \right )}}{a + b \cos {\left (c \right )}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*B+b*B*cos(d*x+c))*sec(d*x+c)/(a+b*cos(d*x+c)),x)

[Out]

Piecewise((B*log(tan(c + d*x) + sec(c + d*x))/d, Ne(d, 0)), (x*(B*a + B*b*cos(c))*sec(c)/(a + b*cos(c)), True)
)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 47 vs. \(2 (12) = 24\).
time = 0.47, size = 47, normalized size = 3.92 \begin {gather*} \frac {B \log \left ({\left | \frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) + 2 \right |}\right ) - B \log \left ({\left | \frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) - 2 \right |}\right )}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*B+b*B*cos(d*x+c))*sec(d*x+c)/(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

1/4*(B*log(abs(1/sin(d*x + c) + sin(d*x + c) + 2)) - B*log(abs(1/sin(d*x + c) + sin(d*x + c) - 2)))/d

________________________________________________________________________________________

Mupad [B]
time = 0.49, size = 16, normalized size = 1.33 \begin {gather*} \frac {2\,B\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*a + B*b*cos(c + d*x))/(cos(c + d*x)*(a + b*cos(c + d*x))),x)

[Out]

(2*B*atanh(tan(c/2 + (d*x)/2)))/d

________________________________________________________________________________________